package com.naton.common.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewbinding.ViewBinding;

/**
 * 整合ViewBinding
 * @param <VB>
 */
public class BaseVBFragment<VB extends ViewBinding> extends BaseFragment {

    protected VB binding;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        if (binding == null){
            binding =  ViewBindingCreator.createViewBinding(getClass(), inflater);
        }
        return binding.getRoot();
    }
}
